package com.example.test.fragment;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/***
 * fragment基类
 * @author Administrator
 *
 */
public abstract class BaseFragment extends Fragment {

	public Context  ct;
	public SharedPreferences sp;

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	  ct=getActivity();
	  
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View view=initView(inflater);
		initData();
		return view;
	}

	/***
	 * 初始化数据的方法
	 */
	public abstract void initData();

	/***
	 * 初始化view的方法
	 * @param inflater
	 * @return
	 */
	public abstract View initView(LayoutInflater inflater);	
}
